package au.com.handsunited.dao.hibernate;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import au.com.handsunited.dao.SkillDAO;
import au.com.handsunited.model.skill.Skill;

/**
 *
 * @author arunda
 */
public class SkillDAOHibernate extends GenericDAOHibernate<Skill, Long> implements SkillDAO {


	private static Logger logger = LoggerFactory.getLogger(SkillDAOHibernate.class);


	/**
	 *
	 */
	public SkillDAOHibernate() {
		super();
	}


	/**
	 * @see au.com.handsunited.dao.impl.SkillDAO#getAllSkills()
	 */
	@Override
	public List<Skill> getAllSkills() {
		List<Skill> skills = getHibernateTemplate().find("from Skill");

		if (logger.isDebugEnabled()) {

			if (skills == null) {
				logger.debug("null list returned for getAllSkills().");
			} else {
				logger.debug("{} skills found.", new String[] {skills.size()+""});
			}
		}

		return skills;
	}

}
